package com.igor.reporting.pages.problem;

import org.apache.tapestry5.annotations.Persist;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.ioc.annotations.Inject;

import com.igor.reporting.dao.problem.ProblemDAO;
import com.igor.reporting.entities.problem.Problem;

public class Edit {

	@Inject
	private ProblemDAO ProblemDAO;

	@Property
	@Persist
	private Problem problem;

	void onActivate(Long id) {
		problem = ProblemDAO.find(id);
	}

	Object onSuccess() {
		ProblemDAO.update(problem);
		return Browse.class;
	}
}
